package com.xinhe.web.controller;

import com.querydsl.core.QueryResults;
import com.xinhe.web.common.Result;
import com.xinhe.web.entity.YunChaSeedAssetCount;
import com.xinhe.web.request.ServiceCenterQuery;
import com.xinhe.web.service.AliyunService;
import com.xinhe.web.service.ServiceCenterService;
import com.xinhe.web.service.YunChaSeedAssetCountService;
import com.xinhe.web.util.ValidatorUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;

@Api(value = "云茶籽释放日期资产表", tags = {"云茶籽释放日期资产表"})
@RestController
@RequestMapping(value = {"/yunChaSeedAssetCount"}, produces = {"application/json;charset=UTF-8"})

public class YunChaSeedAssetCountController {
    @Autowired
    private YunChaSeedAssetCountService yunChaSeedAssetCountService;

    @ApiOperation(httpMethod = "GET", value = "分页查询云茶籽释放日期资产表")
    @RequestMapping({"/pageYunChaSeedAssetCount"})
    public QueryResults<YunChaSeedAssetCount> pageYunChaSeedAssetCount(int pageNum, int pageSize) {
        return this.yunChaSeedAssetCountService.pageYunChaSeedAssetCount(pageNum,pageSize);
    }
    @ApiOperation(httpMethod = "POST", value = "保存云茶籽释放日期资产表")
    @RequestMapping({"/saveYunChaSeedAssetCount"})
    public Result saveYunChaSeedAssetCount(Long configurationDateId, Long userId, BigDecimal balance,String remark) {
        return this.yunChaSeedAssetCountService.saveModel(configurationDateId,  userId,  balance, remark);
    }
    @ApiOperation(httpMethod = "GET", value = "删除云茶籽释放日期资产表")
    @ApiImplicitParam(name = "yunChaSeedAssetCountId", value = "标识", dataTypeClass = Long.class, required = true)
    @RequestMapping({"/deleteYunChaSeedAssetCount"})
    public Result deleteYunChaSeedAssetCount(Long yunChaSeedAssetCountId) {
        return this.yunChaSeedAssetCountService.delete(yunChaSeedAssetCountId);
    }

    @ApiOperation(httpMethod = "GET", value = "云茶籽释放日期资产表详情")
    @ApiImplicitParam(name = "yunChaSeedAssetCountId", value = "标识", dataTypeClass = Long.class, required = true)
    @RequestMapping({"/detailYunChaSeedAssetCount"})
    public Result<YunChaSeedAssetCount> detailYunChaSeedAssetCount(Long yunChaSeedAssetCountId) {
        return this.yunChaSeedAssetCountService.findById(yunChaSeedAssetCountId);
    }

}
